package com.interagriculture.controller;

import com.interagriculture.annotation.AdminVerify;
import com.interagriculture.common.PageResult;
import com.interagriculture.common.Result;
import com.interagriculture.entity.Achievement;
import com.interagriculture.entity.query.AchievementQuery;
import com.interagriculture.service.AchievementService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Achievement)表控制层
 *
 * @author makejava
 * @since 2024-10-24 19:14:25
 */
@RestController
@RequestMapping("achievement")
public class AchievementController {
    /**
     * 服务对象
     */
    @Resource
    private AchievementService achievementService;

    @GetMapping("/getAchievement")
    @AdminVerify
    public Result<PageResult> getAchievement(@RequestBody(required = false) AchievementQuery achievementQuery) {
            PageResult pageResult = achievementService.selectByPage(achievementQuery);
            return Result.ok(pageResult);

    }
}

